<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="内部通讯录" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<link href="/css/Query.css" rel="stylesheet" type="text/css">
<script src="/js/QueryList.js"></script>
<script language="javascript">
	function doSearch(){
		var departmentId="${departmentId}";
		var searchKey=encodeURIComponent(document.getElementById("search_key").value.trim());
		var searchAll="";
		if(document.getElementById("search_all").checked){
			searchAll="1";
		}
		window.location="/base/InnerPbList.ihtm?department_id="+departmentId+"&search_key="+searchKey+"&search_all="+searchAll;
	}
	function doDownload(){
		var departmentId="${departmentId}";
		var searchKey=encodeURIComponent("<c:out value="${searchKey}" />");
		var searchAll="${searchAll}";
		window.location="/base/InnerPbList.ihtm?content_type=EXCEL&department_id="+departmentId+"&search_key="+searchKey+"&search_all="+searchAll;
	}
	function doInit(){
		Window_Onload();
		document.getElementById("search_key").focus();
	}
	function checkSearchKey(){
		if(window.event.keyCode==13){
			doSearch();
		}
	}
	function showSms(mobile,recName){
		showWin(900,500,"/sms/SmsSendForm.ihtm?mobile="+mobile+"&rec_name="+encodeURIComponent(recName));
	}
	function DoubleClick(it){
	}
</script>
</head>
<c:set var="smsFlag" value="0" />
<c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';SMS_SEND_SIMP;')!=-1}"><c:set var="smsFlag" value="1" /></c:if>
<body oncontextmenu="return false" onload="doInit();" scroll="no" style="background: #EAFAFF;">
		<div id="scrollDiv" style="OVERFLOW:auto;height:508px;">
		  <div class="main search-business">
			   <div class="cue-info">
					<h4>
						<c:if test="${searchAll=='1'}">所有部门</c:if>
						<c:if test="${searchAll!='1'}">${department.departmentName}</c:if>
					</h4>				   	
			  </div>
			  <div class="content">		
				  <div align="right">
					<input type="text" class="TextBox" id="search_key" name="search_key" onKeyUp="checkSearchKey();"  value="${searchKey}" title="以员工姓名、姓名拼音字头进行模糊查询">
					<input type="checkbox" id="search_all" name="search_all" <c:if test="${searchAll=='1'}">checked</c:if>>在所有部门中查找
					<input type="button" class="buttom search-but" value=" 查 询" onClick="doSearch();" title="以员工姓名、姓名拼音字头进行模糊查询">		
					<input type="button" class="buttom search-out" value=" 导 出" onClick="doDownload();" <c:if test="${currentUser.user.userType!=1 && fn:indexOf(currentUser.privs,';NO_EXPO;')!=-1}">disabled="true"</c:if>>
				  </div>
			  </div>			  
			  
			  <div class="table-list" style="width:98%; padding:15px 0 15px 10px; float:left;">
					<table width="100%">
						<tr>
							<th width="12%">部门</th>
							<th width="8%">姓名</th>
							<th width="10%">职位</th>
							<th width="12%">手机</th>
							<th width="10%">移动短号</th>
							<th width="12%">QQ</th>
							<th width="14%">邮箱</th>
							<th width="14%">电话</th>
							<th width="8%">分机</th>
						</tr>
						<c:forEach var="item" items="${stafferList}" varStatus="i">
						<c:if test="${(i.index mod 2)==0}"><c:set var="trClass" value="query_list_data_tr1" /></c:if>
						<c:if test="${(i.index mod 2)!=0}"><c:set var="trClass" value="query_list_data_tr2" /></c:if>
						<tr class="${trClass}" index="${i.index+1}" style='cursor:pointer;' onmouseout='javascript:mouseout(this)' ondblclick='javascript:DoubleClick(this)' onmouseover='javascript:mouseover(this)' onClick='javascript:ClickCheck(this)'>
							<td>
								<input type="radio" onClick="javascript:ClickCheck(this);" name='query_checkbox' value="${item.staffer.id}" style="display:none">
								${item.depName}
							</td>
							<td>${item.staffer.stafferName}</td>
							<td>${item.staffer.possie}</td>
							<td style="word-wrap:break-word;word-break:break-all;"><c:if test="${smsFlag=='1'}"><a href="javascript:showSms('${item.staffer.mobile}','${item.staffer.stafferName}');"></c:if>${item.staffer.mobile}<c:if test="${smsFlag=='1'}"></a></c:if></td>
							<td style="word-wrap:break-word;word-break:break-all;">${item.staffer.subMobile}</td>
							<td style="word-wrap:break-word;word-break:break-all;"><a href="http://wpa.qq.com/msgrd?V=1&Uin=${item.staffer.qq}&Site=eking;&Menu=no">${item.staffer.qq}</a></td>
							<td style="word-wrap:break-word;word-break:break-all;"><a href="mailto:${item.staffer.email}">${item.staffer.email}</a></td>
							<td style="word-wrap:break-word;word-break:break-all;">${item.staffer.phone}</td>
							<td style="word-wrap:break-word;word-break:break-all;">${item.staffer.subPhone}</td>
						</tr>
						</c:forEach>							
					</table>
			  </div>
			</div>
		</div>
</body>
</html>